package com.ruoyi.oss.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.enums.YesOrNo;
import com.ruoyi.oss.mapper.PlatformTypeMapper;
import com.ruoyi.oss.entity.PlatformType;
import com.ruoyi.oss.service.PlatformTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author shejiangbo
* @description 针对表【platform_type(支持的平台)】的数据库操作Service实现
* @createDate 2023-05-10 09:01:46
*/
@Service
public class PlatformTypeServiceImpl extends ServiceImpl<PlatformTypeMapper, PlatformType>
    implements PlatformTypeService {


    public List<PlatformType> findEnables(){
        QueryWrapper<PlatformType> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(true,"is_enable", YesOrNo.YES.getValue());
        queryWrapper.orderByAsc("order_num");
        return this.list(queryWrapper);
    }


    public PlatformType findCode(String code){
        QueryWrapper<PlatformType> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(true,"type_code", code);
        return this.getOne(queryWrapper);
    }
}




